package com.stockz.ui.swing.charting.painter;

import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;

import com.stockz.ui.swing.charting.view.StockChartPanel;

public class CrosshairPainter{

	public static void paint(Graphics2D g, StockChartPanel view, Rectangle rectangle) {
		g.setClip(rectangle);
		g.setColor(view.getStockChartPanelSkin().getCrosshairColor());
		Point point = view.getStockChartPanelState().getCurrentPoint();
		g.drawLine(rectangle.x,point.y, rectangle.x+rectangle.width, point.y);
		g.drawLine(point.x,rectangle.y, point.x, rectangle.y+rectangle.height);
		g.setClip(null);
	}
}
